import { ref } from 'vue';

import { defineStore } from 'pinia';

import { toggleTheme } from '@/utils/index';

export const useAppStore = defineStore('_app', () => {
  const theme = ref('light');
  const changeTheme = (type: string) => {
    toggleTheme(type);
    theme.value = type;
  };

  return {
    theme,
    changeTheme,
  };
});
